<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link th:href="@{../css/shop.css}" type="text/css" rel="stylesheet" />
<link th:href="@{../css/Sellerber.css}" type="text/css"  rel="stylesheet" />
<link th:href="@{../css/bkg_ui.css}" type="text/css"  rel="stylesheet" />
<link th:href="@{../font/css/font-awesome.min.css}"  rel="stylesheet" type="text/css" />
<link th:href="@{../css/Coupon.css}"  rel="stylesheet" type="text/css" />
<link th:href="@{../layui/css/layui.css}"  rel="stylesheet" type="text/css" />
    <link th:href="@{../css/bootstrap.css}"  rel="stylesheet" type="text/css" />
    <style type="text/css">
        .choice_search .label_name{ height:32px; line-height:32px; float:left; text-align:right; width:80px;}
        body{overflow-y:auto; width:1330px; height:610px; overflow:auto; border:1px solid #000000;}
        #demo1{}
    </style>
    <script th:src="@{../js/jquery-1.9.1.min.js}" type="text/javascript" ></script>
    <!--<script th:src="@{../js/bootstrap.js}" type="text/javascript" ></script>-->
    <script type="text/javascript" th:src="@{../js/Coupon.js}"></script>
    <script type="text/javascript" th:src="@{../layui/layui.js}"></script>
    <script th:src="@{/js/layer/layer.js}" type="text/javascript"></script>
<title>优惠券列表</title>
</head>
<body>
<div class="margin" id="page_style">
    <form id="loginFor8unm" action="/CouponController/getAll">
        <div class="operation clearfix mb15 same_module">
            <ul class="choice_search">
                <li class="clearfix col-xs-3 col-lg-3 col-ms-3 ">
                    <label class=" col-xs-6 col-lg-6 col-ms-">优惠券名称：</label>
                    <input type="text" id="CouponName" name="couponname" class="form-control col-xs-3 col-lg-3 col-ms-3">
                </li>
                <li class="clearfix col-xs-3 col-lg-3 col-ms-3">
                    <label class=" col-xs-5 col-lg-5 col-ms-5">优惠券类型：</label>
                    <!--<input class="laydate-icon col-xs-3 col-lg-3 form-control" id="start1" >-->
                    <select class="form-control col-xs-6 col-lg-6 col-ms-6" id="CouponType" name="coupontype">
                        <option value="">全部类型</option>
                        <option value="0">无门槛</option>
                        <option value="1">类型</option>
                        <option value="2">商品</option>
                    </select>
                </li>
                <li class="clearfix col-xs-3 col-lg-3 col-ms-3 ">
                    <label class=" col-xs-5 col-lg-5 col-ms-5">优惠券状态：</label>
                    <!--<input class="laydate-icon col-xs-3 col-lg-3 form-control" id="start1" >-->
                    <select class="form-control col-xs-6 col-lg-6 col-ms-6" id="CouponStatus" name="status">
                        <option value="">全部状态</option>
                        <option value="0">过期</option>
                        <option value="1">可用</option>
                    </select>
                </li>
                <li class="clearfix col-xs-3 col-lg-3 col-ms-3 ">
                    <label class=" col-xs-5 col-lg-5 col-ms-5">是否可用：</label>
                    <!--<input class="laydate-icon col-xs-3 col-lg-3 form-control" id="start1" >-->
                    <select class="form-control col-xs-6 col-lg-6 col-ms-6" id="CouponDisable" name="disable">
                        <option value="">全部状态</option>
                        <option value="0">可售</option>
                        <option value="1">停售</option>
                    </select>
                </li>
            </ul>
            <ul  class="choice_search">
                <li class="clearfix col-xs-3 col-lg-3 col-ms-3 layui-col-md-offset9">
                    <button class="btn button_btn bg-deep-blue col-ms-3 "id="submit" type="submit"><i class="fa  fa-search"></i>&nbsp;搜索</button>
                </li>
            </ul>
        </div>
    </form>
<!--列表展示-->
    <div class="h_products_list clearfix" id="Sellerber">
        <div class="list_Exhibition list_show padding15">
            <div class="operation clearfix mb15 searchs_style">
                <span class="submenu">
                    <a id="aaaa" name="" shiro:hasPermission="user:addCoupon" class="btn button_btn bg-deep-blue" data-toggle="modal" data-target="#myModal"><i class="fa  fa-edit"></i>&nbsp;添加优惠券</a>
                </span>
            </div>
        <div class="datalist_show">
            <div class="datatable_height confirm">
                <table class="table table_list table_striped table-bordered" id="">
                    <thead>
                        <th width="250px">优惠券名称</th>
                        <th width="100px">类型</th>
                        <th width="100px">面值</th>
                        <th width="100px">库存</th>
                        <th width="100px">开始时间</th>
                        <th width="100px">结束时间</th>
                        <th width="80px">天数</th>
                        <th width="80px">状态</th>
                        <th width="80px">是否可售</th>
                        <th width="100px">操作</th>
                    </thead>
                    <tbody id="coupInfo">
                   <tr th:each="e:${couponList.content}">
                        <td width="80px" th:text="${e.couponid}" style="display: none"></td>
                        <td width="200px" th:text="${e.couponname}"></td>
                        <div th:switch="${e.coupontype}">
                            <td width="100px" th:case="0">无门槛</td>
                            <td width="100px" th:case="1">类型</td>
                            <td width="100px" th:case="2">商品</td>
                        </div>
                        <td width="100px" th:text="${e.couponvalue}"></td>
                        <td width="100px" th:text="${e.couponrepertory}"></td>
                        <td width="100px" th:text="${e.endtime}"></td>
                        <td width="100px" th:text="${e.starttime}"></td>
                        <td class="td-status"><span class="label label-success radius" th:text="${e.numberdays}">天</span></td>
                        <div th:switch="${e.status}">
                            <td width="100px" th:case="0">过期</td>
                            <td width="100px" th:case="1">可用</td>
                        </div>
                        <div th:switch="${e.disable}">
                            <td width="100px" th:case="0">可售</td>
                            <td width="100px" th:case="1">停售</td>
                        </div>
                        <td class="td-manage">
                            <button class="btn button_btn btn-danger deltoo" shiro:hasPermission="user:deleteCoupon" type="button" >停售</button>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
        </div>
    </div>
</div>
<div id="names" th:text="${CouponName}" style="display: none"></div>
<div id="types" th:text="${CouponType}" style="display: none"></div>
<div id="status" th:text="${Status}" style="display: none"></div>
<div id="disable" th:text="${Disable}" style="display: none"></div>

<div id="number" th:text="${couponList.number}" style="display: none"></div>
<div id="totalElements" th:text="${couponList.totalElements}" style="display: none"></div>


<div class="layui-row">
    <div class="layui-col-md6 layui-col-md-offset4">
        <div id="demo1"></div>
    </div>
</div>
<script type="text/javascript">
    $(function(){
        $("#aaaa").click(function () {
            location.href="/CouponController/showAdd"
        })
    })
</script>

</body>
</html>
